import * as vscode from 'vscode'
import config from '../presets'

const LANGUAGES = ['css', 'scss']


export default function getCodeCompletionProvider(projectConfig: any) {
	return vscode.languages.registerCompletionItemProvider(
		LANGUAGES,
		{
			async provideCompletionItems() {
				const fontSizeItems = config.fontSize
	
				const fontWeightItems = config.fontWeight
	
				const spacingItems = config.spacing
	
				const { presets } = projectConfig;
	
				return [
					...fontSizeItems,
					...fontWeightItems,
					...spacingItems,
					...(presets || []),
				]
			},
		}
	)
}
